/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package app.model_package;

/**
 *
 * @author haythem
 */
public class SuccessionRelation {
    private String predecessorX ;
    private String successorY ;

    public SuccessionRelation(String predecessorX, String successorY) {
        this.predecessorX = predecessorX;
        this.successorY = successorY;
    }

    public String getPredecessorX() {
        return predecessorX;
    }

    public String getSuccessorY() {
        return successorY;
    }

    public void setPredecessorX(String predecessorX) {
        this.predecessorX = predecessorX;
    }

    public void setSuccessorY(String successorY) {
        this.successorY = successorY;
    }

    public String toString(){
        return predecessorX+"->"+successorY;
    }

    /**
     * compars this object with an other SuccessionRelation
     * object
     * @param sr
     * @return
     */
    public boolean equals(SuccessionRelation sr){
        return ((sr.getPredecessorX().equals((String) this.predecessorX)) && (sr.getSuccessorY().equals((String) this.successorY)));
    }


    /**
     * 
     * @param predecessor
     * @param successor
     * @return
     */
    public boolean equals(String predecessor, String successor){
        return ((predecessor.equals((String) this.predecessorX)) && (successor.equals((String) this.successorY)));
    }
}
